{% extends "templates/base.phtml"%}
{%block content%}
<div class="page-content-wrap">
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-default tabs">
                <ul class="nav nav-tabs" role="tablist">
                    <li><a href="/admin/config/wx">微信配置</a></li>
                    <li class="active"><a href="/admin/config/alipay">支付宝配置</a></li>
                </ul>
                <div class="panel-body tab-content">
                    <div class="tab-pane active">
                        <div class="col-md-12">
                            <h3>支付宝服务窗对接平台配置</h3>
                            <form class="form-horizontal" method="post">
                                <div class="panel panel-default">
                                    <div class="panel-body">

                                        <div class="form-group">
                                            <label class="col-md-3 col-xs-12 control-label">支付宝服务窗名称</label>
                                            <div class="col-md-6 col-xs-12">
                                                <div class="input-group">
                                                    <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                                    <input name="aliname" type="text" class="form-control" value="{% if alipay.aliname is defined %}{{alipay.aliname}}{% endif %}">
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-md-3 col-xs-12 control-label">AppID:</label>
                                            <div class="col-md-6 col-xs-12">
                                                <div class="input-group">
                                                    <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                                    <input name="appid" type="text" class="form-control" value="{% if alipay.appid is defined %}{{alipay.appid}}{% endif %}">
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-md-3 col-xs-12 control-label">公钥</label>
                                            <div class="col-md-6 col-xs-12" style="word-wrap: break-word;">
                                              <p>{{key}}</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 col-xs-12 control-label">头像：</label>
                                            <div class="col-md-6 col-xs-12">
                                                <input id="fileup" name="fileup" type="file" multiple="true">
                                                <input id="headpic" name="headpic" class="form-control"  type="hidden" value="">
                                                <img id="thumb" src="{% if alipay.headpic is defined %}{{alipay.headpic}}{% endif %}" style="max-height: 200px;max-width: 200px">
                                            </div>
                                        </div>
                                        <div class="form-group col-md-12">
                                            <div class="col-md-6 col-xs-12 col-md-offset-4">
                                                <button class="btn btn-primary">保存</button>
<!--                                                <button class="btn btn-danger" type="button">取消</button>-->
                                            </div>
                                        </div>
                                    </div>

                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{%endblock%}{%block end%}
<style type="text/css">
    .user-info-penal p{
        padding-top: 0.6em;
    }
    table th,table td{
        text-align: center;
    }
</style>
<script src="/assets/uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="/assets/uploadify/uploadify.css">
<script type="text/javascript">

    $(function() {
        $('#fileup').uploadify({
            'formData'     : {
            },
            'swf'      : '/assets/uploadify/uploadify.swf',
            'uploader' : '/admin/resource/upload',
            'cancelImg': '/assets/uploadify/uploadify-cancel.png',//单个取消上传的图片
            'onUploadSuccess': function (file, data, response) {
                var data = JSON.parse(data);
                if (data.status == 1) {
                    $('#headpic').val(data.data);
                    $('#thumb').attr("src",data.data);
                    $('#thumb').css("display","block");
                }

            }
        });

    });
</script>
{%endblock%}